package com.ant.myagile

import com.ant.myagile.backlog.Sprint;

class SprintService {

    def Set<Sprint> findSprintByTeamId(teamID) {
		Team team = Team.get(teamID)		
		return team.sprints
	}
	
	def findLastSprintByTeamId(teamID){
		def lastSprint = Sprint.executeQuery("select id, sprintName from Sprint where team="+teamID+" and dateEnd=(select max(dateEnd) from Sprint where team="+teamID+")")
		return lastSprint
	} 
}
